package com.dap.commons;

/**
 * Created by wangmin on 2018/10/29.
 */
public enum ApplicationEnum {
    jiujiajiu_cloudStore("久加久云商", "59a00be3d57a8fae9a53af34"),
    jiujiajiu_sales("久加久云销", "334cec0855614761c4b106d4"),
    jiujiajiu_superc("久加久久集", ""),
    jiujiajiu_jmall("久加久jmall", ""),
    jiujiajiu_catering("久加久点餐", ""),

    shangyuan_sales("商源云销", "560a209b20850040e2a2833a");

    protected String applicationName;
    protected String jpushAppId;

    ApplicationEnum(String applicationName, String jpushAppId) {
        this.applicationName = applicationName;
        this.jpushAppId = jpushAppId;
    }

    public String getApplicationName() {
        return applicationName;
    }
    public String getJpushAppId() {
        return jpushAppId;
    }

    public static ApplicationEnum parseByJpushAppId(String jpushAppId) {
        if (null == jpushAppId || jpushAppId.isEmpty())
            return null;

        ApplicationEnum[] list = ApplicationEnum.values();
        for (int i = 0; i < list.length; ++i) {
            if (jpushAppId.equals(list[i].jpushAppId))
                return list[i];
        }

        return null;
    }
}
